home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / view / nsIViewManager.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  24KB  |  592 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #ifndef nsIViewManager_h___
  39. #define nsIViewManager_h___
  40.  
  41. #include "nscore.h"
  42. #include "nsIView.h"
  43. #include "nsColor.h"
  44. #include "nsEvent.h"
  45.  
  46. class nsIScrollableView;
  47. class nsIWidget;
  48. class nsICompositeListener;
  49. struct nsRect;
  50. class nsRegion;
  51. class nsIDeviceContext;
  52. class nsIViewObserver;
  53.  
  54. enum nsRectVisibility { 
  55.   nsRectVisibility_kVisible, 
  56.   nsRectVisibility_kAboveViewport, 
  57.   nsRectVisibility_kBelowViewport, 
  58.   nsRectVisibility_kLeftOfViewport, 
  59.   nsRectVisibility_kRightOfViewport, 
  60.   nsRectVisibility_kZeroAreaRect
  61. }; 
  62.  
  63.  
  64. #define NS_IVIEWMANAGER_IID   \
  65. { 0xd9af8f22, 0xc64d, 0x4036, \
  66.   { 0x9e, 0x8b, 0x69, 0x5a, 0x63, 0x69, 0x3f, 0xd3 } }
  67.  
  68. class nsIViewManager : public nsISupports
  69. {
  70. public:
  71.  
  72.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IVIEWMANAGER_IID)
  73.   /**
  74.    * Initialize the ViewManager
  75.    * Note: this instance does not hold a reference to the viewobserver
  76.    * because it holds a reference to this instance.
  77.    * @result The result of the initialization, NS_OK if no errors
  78.    */
  79.   NS_IMETHOD  Init(nsIDeviceContext* aContext) = 0;
  80.  
  81.   /**
  82.    * Create an ordinary view
  83.    * @param aBounds initial bounds for view
  84.    *        XXX We should eliminate this parameter; you can set the bounds after CreateView
  85.    * @param aParent intended parent for view. this is not actually set in the
  86.    *        nsIView through this method. it is only used by the initialization
  87.    *        code to walk up the view tree, if necessary, to find resources.
  88.    *        XXX We should eliminate this parameter!
  89.    * @param aVisibilityFlag initial visibility state of view
  90.    *        XXX We should eliminate this parameter; you can set it after CreateView
  91.    * @result The new view
  92.    */
  93.   NS_IMETHOD_(nsIView*) CreateView(const nsRect& aBounds,
  94.                                    const nsIView* aParent,
  95.                                    nsViewVisibility aVisibilityFlag = nsViewVisibility_kShow) = 0;
  96.  
  97.   /**
  98.    * Create an scrollable view
  99.    * @param aBounds initial bounds for view
  100.    *        XXX We should eliminate this parameter; you can set the bounds after CreateScrollableView
  101.    * @param aParent intended parent for view. this is not actually set in the
  102.    *        nsIView through this method. it is only used by the initialization
  103.    *        code to walk up the view tree, if necessary, to find resources.
  104.    *        XXX We should eliminate this parameter!
  105.    * @result The new view
  106.    */
  107.   NS_IMETHOD_(nsIScrollableView*) CreateScrollableView(const nsRect& aBounds,
  108.                                                        const nsIView* aParent) = 0;
  109.  
  110.   /**
  111.    * Get the root of the view tree.
  112.    * @result the root view
  113.    */
  114.   NS_IMETHOD  GetRootView(nsIView *&aView) = 0;
  115.  
  116.   /**
  117.    * Set the root of the view tree. Does not destroy the current root view.
  118.    * aView may have a parent view managed by a different view manager.
  119.    * aView may have a widget (anything but printing) or may not (printing).
  120.    * @param aView view to set as root
  121.    */
  122.   NS_IMETHOD  SetRootView(nsIView *aView) = 0;
  123.  
  124.   /**
  125.    * Get the dimensions of the root window. The dimensions are in
  126.    * twips
  127.    * @param aWidth out parameter for width of window in twips
  128.    * @param aHeight out parameter for height of window in twips
  129.    */
  130.   NS_IMETHOD  GetWindowDimensions(nscoord *aWidth, nscoord *aHeight) = 0;
  131.  
  132.   /**
  133.    * Set the dimensions of the root window.
  134.    * Called if the root window is resized. The dimensions are in
  135.    * twips
  136.    * @param aWidth of window in twips
  137.    * @param aHeight of window in twips
  138.    */
  139.   NS_IMETHOD  SetWindowDimensions(nscoord aWidth, nscoord aHeight) = 0;
  140.  
  141.   /**
  142.    * Called to force a redrawing of any dirty areas.
  143.    */
  144.   // XXXbz why is this exposed?  Shouldn't update view batches handle this?
  145.   // It's not like Composite() does what's expected inside a view update batch
  146.   // anyway, since dirty areas may not have been invalidated on the widget yet
  147.   // and widget changes may not have been propagated yet.  Maybe this should
  148.   // call FlushPendingInvalidates()?
  149.   NS_IMETHOD  Composite(void) = 0;
  150.  
  151.   /**
  152.    * Called to inform the view manager that the entire area of a view
  153.    * is dirty and needs to be redrawn.
  154.    * @param aView view to paint. should be root view
  155.    * @param aUpdateFlags see bottom of nsIViewManager.h for description
  156.    */
  157.   NS_IMETHOD  UpdateView(nsIView *aView, PRUint32 aUpdateFlags) = 0;
  158.  
  159.   /**
  160.    * Called to inform the view manager that some portion of a view
  161.    * is dirty and needs to be redrawn. The rect passed in
  162.    * should be in the view's coordinate space.
  163.    * @param aView view to paint. should be root view
  164.    * @param rect rect to mark as damaged
  165.    * @param aUpdateFlags see bottom of nsIViewManager.h for description
  166.    */
  167.   NS_IMETHOD  UpdateView(nsIView *aView, const nsRect &aRect, PRUint32 aUpdateFlags) = 0;
  168.  
  169.   /**
  170.    * Called to inform the view manager that it should redraw all views.
  171.    * @param aView view to paint. should be root view
  172.    * @param aUpdateFlags see bottom of nsIViewManager.h for description
  173.    */
  174.   NS_IMETHOD  UpdateAllViews(PRUint32 aUpdateFlags) = 0;
  175.  
  176.   /**
  177.    * Called to dispatch an event to the appropriate view. Often called
  178.    * as a result of receiving a mouse or keyboard event from the widget
  179.    * event system.
  180.    * @param event event to dispatch
  181.    * @result event handling status
  182.    */
  183.   NS_IMETHOD  DispatchEvent(nsGUIEvent *aEvent, nsEventStatus* aStatus) = 0;
  184.  
  185.   /**
  186.    * Used to grab/capture all mouse events for a specific view,
  187.    * irrespective of the cursor position at which the
  188.    * event occurred.
  189.    * @param aView view to capture mouse events
  190.    * @result event handling status
  191.    */
  192.   NS_IMETHOD  GrabMouseEvents(nsIView *aView, PRBool& aResult) = 0;
  193.  
  194.   /**
  195.    * Used to grab/capture all keyboard events for a specific view,
  196.    * irrespective of the cursor position at which the
  197.    * event occurred.
  198.    * @param aView view to capture keyboard events
  199.    * @result event handling status
  200.    */
  201.   NS_IMETHOD  GrabKeyEvents(nsIView *aView, PRBool& aResult) = 0;
  202.  
  203.   /**
  204.    * Get the current view, if any, that's capturing mouse events.
  205.    * @result view that is capturing mouse events or nsnull
  206.    */
  207.   NS_IMETHOD  GetMouseEventGrabber(nsIView *&aView) = 0;
  208.  
  209.   /**
  210.    * Get the current view, if any, that's capturing keyboard events.
  211.    * @result view that is capturing keyboard events or nsnull
  212.    */
  213.   NS_IMETHOD  GetKeyEventGrabber(nsIView *&aView) = 0;
  214.  
  215.   /**
  216.    * Given a parent view, insert another view as its child.
  217.    * aSibling and aAbove control the "document order" for the insertion.
  218.    * If aSibling is null, the view is inserted at the end of the document order
  219.    * if aAfter is PR_TRUE, otherwise it is inserted at the beginning.
  220.    * If aSibling is non-null, then if aAfter is PR_TRUE, the view is inserted
  221.    * after the sibling in document order (appearing above the sibling unless
  222.    * overriden by z-order).
  223.    * If it is PR_FALSE, the view is inserted before the sibling.
  224.    * The view manager generates the appopriate dirty regions.
  225.    * @param aParent parent view
  226.    * @param aChild child view
  227.    * @param aSibling sibling view
  228.    * @param aAfter after or before in the document order
  229.    */
  230.   NS_IMETHOD  InsertChild(nsIView *aParent, nsIView *aChild, nsIView *aSibling,
  231.                           PRBool aAfter) = 0;
  232.  
  233.   /**
  234.    * Given a parent view, insert a placeholder for a view that logically
  235.    * belongs to this parent but has to be moved somewhere else for geometry
  236.    * reasons ("fixed" positioning).
  237.    * @param aParent parent view
  238.    * @param aChild child view
  239.    * @param aSibling sibling view
  240.    * @param aAfter after or before in the document order
  241.    */
  242.   NS_IMETHOD  InsertZPlaceholder(nsIView *aParent, nsIView *aChild, nsIView *aSibling,
  243.                                  PRBool aAfter) = 0;
  244.  
  245.   /**
  246.    * Remove a specific child view from its parent. This will NOT remove its placeholder
  247.    * if there is one.
  248.    * The view manager generates the appropriate dirty regions.
  249.    * @param aParent parent view
  250.    * @param aChild child view
  251.    */
  252.   NS_IMETHOD  RemoveChild(nsIView *aChild) = 0;
  253.  
  254.   /**
  255.    * Move a view to the specified position, provided in parent coordinates.
  256.    * The new position is the (0, 0) origin for the view's coordinate system.
  257.    * The view's bounds may extend above or to the left of this point.
  258.    * The view manager generates the appropriate dirty regions.
  259.    * @param aView view to move
  260.    * @param aX x value for new view position
  261.    * @param aY y value for new view position
  262.    */
  263.   NS_IMETHOD  MoveViewTo(nsIView *aView, nscoord aX, nscoord aY) = 0;
  264.  
  265.   /**
  266.    * Resize a view. In addition to setting the width and height, you can
  267.    * set the x and y of its bounds relative to its position. Negative x and y
  268.    * will let the view extend above and to the left of the (0,0) point in its
  269.    * coordinate system.
  270.    * The view manager generates the appropriate dirty regions.
  271.    * @param aView view to move
  272.    * @param the new bounds relative to the current position
  273.    * @param RepaintExposedAreaOnly
  274.    *     if PR_TRUE Repaint only the expanded or contracted region,
  275.    *     if PR_FALSE Repaint the union of the old and new rectangles.
  276.    */
  277.   NS_IMETHOD  ResizeView(nsIView *aView, const nsRect &aRect,
  278.                          PRBool aRepaintExposedAreaOnly = PR_FALSE) = 0;
  279.  
  280.   /**
  281.    * Set the region to which a view's descendants are clipped.  The view
  282.    * itself is not clipped to this region; this allows for effects
  283.    * where part of the view is drawn outside the clip region (e.g.,
  284.    * its borders and background).  The view manager generates the
  285.    * appropriate dirty regions.
  286.    * 
  287.    * @param aView view to set clipping for
  288.    * @param aRegion
  289.    *     if null then no clipping is required. In this case all descendant
  290.    * views (but not descendants through placeholder edges) must have their
  291.    * bounds inside the bounds of this view
  292.    *     if non-null, then we will clip this view's descendant views
  293.    * --- including descendants through placeholder edges ---
  294.    * to the region. The region's bounds must be within the bounds of
  295.    * this view. The descendant views' bounds need not be inside the bounds
  296.    * of this view (because we're going to clip them anyway).
  297.    *
  298.    * XXX Currently we only support regions consisting of a single rectangle.
  299.    */
  300.   NS_IMETHOD  SetViewChildClipRegion(nsIView *aView, const nsRegion *aRegion) = 0;
  301.  
  302.   /**
  303.    * Set the visibility of a view.
  304.    * The view manager generates the appropriate dirty regions.
  305.    * @param aView view to change visibility state of
  306.    * @param visible new visibility state
  307.    */
  308.   NS_IMETHOD  SetViewVisibility(nsIView *aView, nsViewVisibility aVisible) = 0;
  309.  
  310.   /**
  311.    * Set the z-index of a view. Positive z-indices mean that a view
  312.    * is above its parent in z-order. Negative z-indices mean that a
  313.    * view is below its parent.
  314.    * The view manager generates the appropriate dirty regions.
  315.    * @param aAutoZIndex indicate that the z-index of a view is "auto". An "auto" z-index
  316.    * means that the view does not define a new stacking context,
  317.    * which means that the z-indicies of the view's children are
  318.    * relative to the view's siblings.
  319.    * @param aView view to change z depth of
  320.    * @param aZindex explicit z depth
  321.    * @param aTopMost used when this view is z-index:auto to compare against 
  322.    *        other z-index:auto views.
  323.    *        PR_TRUE if the view should be topmost when compared with 
  324.    *        other z-index:auto views.
  325.    */
  326.   NS_IMETHOD  SetViewZIndex(nsIView *aView, PRBool aAutoZIndex, PRInt32 aZindex, PRBool aTopMost = PR_FALSE) = 0;
  327.  
  328.   /**
  329.    * Set whether the view "floats" above all other views,
  330.    * which tells the compositor not to consider higher views in
  331.    * the view hierarchy that would geometrically intersect with
  332.    * this view. This is a hack, but it fixes some problems with
  333.    * views that need to be drawn in front of all other views.
  334.    */
  335.   NS_IMETHOD  SetViewFloating(nsIView *aView, PRBool aFloatingView) = 0;
  336.  
  337.   /**
  338.    * Set whether the view can be bitblitted during scrolling.
  339.    */
  340.   NS_IMETHOD  SetViewBitBltEnabled(nsIView *aView, PRBool aEnable) = 0;
  341.  
  342.   /**
  343.    * Set whether the view's children should be searched during event processing.
  344.    */
  345.   NS_IMETHOD  SetViewCheckChildEvents(nsIView *aView, PRBool aEnable) = 0;
  346.  
  347.   /**
  348.    * Used set the transparency status of the content in a view. see
  349.    * nsIView.HasTransparency().
  350.    * @param aTransparent PR_TRUE if there are transparent areas, PR_FALSE otherwise.
  351.    */
  352.   NS_IMETHOD  SetViewContentTransparency(nsIView *aView, PRBool aTransparent) = 0;
  353.  
  354.   /**
  355.    * Note: This didn't exist in 4.0. Called to set the opacity of a view. 
  356.    * A value of 0.0 means completely transparent. A value of 1.0 means
  357.    * completely opaque.
  358.    * @param opacity new opacity value
  359.    */
  360.   NS_IMETHOD  SetViewOpacity(nsIView *aView, float aOpacity) = 0;
  361.  
  362.   /**
  363.    * Set the view observer associated with this manager
  364.    * @param aObserver - new observer
  365.    * @result error status
  366.    */
  367.   NS_IMETHOD SetViewObserver(nsIViewObserver *aObserver) = 0;
  368.  
  369.   /**
  370.    * Get the view observer associated with this manager
  371.    * @param aObserver - out parameter for observer
  372.    * @result error status
  373.    */
  374.   NS_IMETHOD GetViewObserver(nsIViewObserver *&aObserver) = 0;
  375.  
  376.   /**
  377.    * Get the device context associated with this manager
  378.    * @result device context
  379.    */
  380.   NS_IMETHOD  GetDeviceContext(nsIDeviceContext *&aContext) = 0;
  381.  
  382.   /**
  383.    * prevent the view manager from refreshing.
  384.    * @return error status
  385.    */
  386.   // XXXbz callers of this function don't seem to realize that it disables
  387.   // refresh for the entire view manager hierarchy.... Maybe it shouldn't do
  388.   // that?
  389.   NS_IMETHOD DisableRefresh(void) = 0;
  390.  
  391.   /**
  392.    * allow the view manager to refresh. this may cause a synchronous
  393.    * paint to occur inside the call.
  394.    * @param aUpdateFlags see bottom of nsIViewManager.h for description
  395.    * @return error status
  396.    */
  397.   NS_IMETHOD EnableRefresh(PRUint32 aUpdateFlags) = 0;
  398.  
  399.   /**
  400.    * prevents the view manager from refreshing. allows UpdateView()
  401.    * to notify widgets of damaged regions that should be repainted
  402.    * when the batch is ended.
  403.    * @return error status
  404.    */
  405.   NS_IMETHOD BeginUpdateViewBatch(void) = 0;
  406.  
  407.   /**
  408.    * allow the view manager to refresh any damaged areas accumulated
  409.    * after the BeginUpdateViewBatch() call.  this may cause a
  410.    * synchronous paint to occur inside the call if aUpdateFlags
  411.    * NS_VMREFRESH_IMMEDIATE is set.
  412.    *
  413.    * If this is not the outermost view batch command, then this does
  414.    * nothing except that the specified flags are remembered. When the
  415.    * outermost batch finally ends, we merge together all the flags for the
  416.    * inner batches in the following way:
  417.    * -- If any batch specified NS_VMREFRESH_IMMEDIATE, then we use that flag
  418.    * (i.e. there is a synchronous paint under the last EndUpdateViewBatch)
  419.    * -- Otherwise if any batch specified NS_VMREFERSH_DEFERRED, then we use
  420.    * that flag (i.e. invalidation is deferred until the processing of an
  421.    * Invalidate PLEvent)
  422.    * -- Otherwise all batches specified NS_VMREFRESH_NO_SYNC and we honor
  423.    * that; all widgets are invalidated normally and will be painted the next
  424.    * time the toolkit chooses to update them.
  425.    *
  426.    * @param aUpdateFlags see bottom of nsIViewManager.h for
  427.    * description @return error status
  428.    */
  429.   NS_IMETHOD EndUpdateViewBatch(PRUint32 aUpdateFlags) = 0;
  430.  
  431.   /**
  432.    * set the view that is is considered to be the root scrollable
  433.    * view for the document.
  434.    * @param aScrollable root scrollable view
  435.    * @return error status
  436.    */
  437.   NS_IMETHOD SetRootScrollableView(nsIScrollableView *aScrollable) = 0;
  438.  
  439.   /**
  440.    * get the view that is is considered to be the root scrollable
  441.    * view for the document.
  442.    * @param aScrollable out parameter for root scrollable view
  443.    * @return error status
  444.    */
  445.   NS_IMETHOD GetRootScrollableView(nsIScrollableView **aScrollable) = 0;
  446.  
  447.   /**
  448.    * Display the specified view. Used when printing.
  449.    */
  450.    //XXXbz how is this different from UpdateView(NS_VMREFRESH_IMMEDIATE)?
  451.   NS_IMETHOD Display(nsIView *aView, nscoord aX, nscoord aY, const nsRect& aClipRect) = 0;
  452.  
  453.   /**
  454.    * Dump the specified view into a new offscreen rendering context.
  455.    * @param aRect is the region to capture into the offscreen buffer, in the view's
  456.    * coordinate system
  457.    * @param aUntrusted set to PR_TRUE if the contents may be passed to malicious
  458.    * agents. E.g. we might choose not to paint the contents of sensitive widgets
  459.    * such as the file name in a file upload widget, and we might choose not
  460.    * to paint themes.
  461.    * @param aIgnoreViewportScrolling ignore clipping/scrolling/scrollbar painting
  462.    * due to scrolling in the viewport
  463.    * @param aBackgroundColor a background color to render onto
  464.    * @param aRenderedContext gets set to a rendering context whose offscreen
  465.    * buffer can be locked to get the data. The buffer's size will be aRect's size.
  466.    * In all cases the caller must clean it up by calling
  467.    * cx->DestroyDrawingSurface(cx->GetDrawingSurface()).
  468.    */
  469.   NS_IMETHOD RenderOffscreen(nsIView* aView, nsRect aRect, PRBool aUntrusted,
  470.                              PRBool aIgnoreViewportScrolling,
  471.                              nscolor aBackgroundColor,
  472.                              nsIRenderingContext** aRenderedContext) = 0;
  473.  
  474.   /**
  475.    * Add a listener to the view manager's composite listener list.
  476.    * @param aListener - new listener
  477.    * @result error status
  478.    */
  479.   NS_IMETHOD AddCompositeListener(nsICompositeListener *aListener) = 0;
  480.  
  481.   /**
  482.    * Remove a listener from the view manager's composite listener list.
  483.    * @param aListener - listener to remove
  484.    * @result error status
  485.    */
  486.   NS_IMETHOD RemoveCompositeListener(nsICompositeListener *aListener) = 0;
  487.  
  488.   /**
  489.    * Retrieve the widget at the root of the view manager. This is the
  490.    * widget associated with the root view, if the root view exists and has
  491.    * a widget.
  492.    */
  493.   NS_IMETHOD GetWidget(nsIWidget **aWidget) = 0;
  494.  
  495.   /**
  496.    * Force update of view manager widget
  497.    * Callers should use UpdateView(view, NS_VMREFRESH_IMMEDIATE) in most cases instead
  498.    * @result error status
  499.    */
  500.   // XXXbz Callers seem to be confused about this one... and it doesn't play
  501.   // right with view update batching at all (will miss updates).  Maybe this
  502.   // should call FlushPendingInvalidates()?
  503.   NS_IMETHOD ForceUpdate() = 0;
  504.   
  505.   /**
  506.    * Control double buffering of the display. If double buffering
  507.    * is enabled the viewmanager is allowed to render to an offscreen
  508.    * drawing surface before copying to the display in order to prevent
  509.    * flicker. If it is disabled all rendering will appear directly on the
  510.    * the display. The display is double buffered by default.
  511.    * @param aDoubleBuffer PR_TRUE to enable double buffering
  512.    *                      PR_FALSE to disable double buffering
  513.    */
  514.   NS_IMETHOD AllowDoubleBuffering(PRBool aDoubleBuffer)=0;
  515.  
  516.   /**
  517.    * Indicate whether the viewmanager is currently painting
  518.    *
  519.    * @param aPainting PR_TRUE if the viewmanager is painting
  520.    *                  PR_FALSE otherwise
  521.    */
  522.   NS_IMETHOD IsPainting(PRBool& aIsPainting)=0;
  523.  
  524.   /**
  525.    * Set the default background color that the view manager should use
  526.    * to paint otherwise unowned areas. If the color isn't known, just set
  527.    * it to zero (which means 'transparent' since the color is RGBA).
  528.    *
  529.    * @param aColor the default background color
  530.    */
  531.   NS_IMETHOD SetDefaultBackgroundColor(nscolor aColor)=0;
  532.  
  533.   /**
  534.    * Retrieve the default background color.
  535.    *
  536.    * @param aColor the default background color
  537.    */
  538.   NS_IMETHOD GetDefaultBackgroundColor(nscolor* aColor)=0;
  539.  
  540.   /**
  541.    * Retrieve the time of the last user event. User events
  542.    * include mouse and keyboard events. The viewmanager
  543.    * saves the time of the last user event.
  544.    *
  545.    * @param aTime Last user event time in microseconds
  546.    */
  547.   NS_IMETHOD GetLastUserEventTime(PRUint32& aTime)=0;
  548.  
  549.   /**
  550.    * Determine if a rectangle specified in the view's coordinate system 
  551.    * is completely, or partially visible.
  552.    * @param aView view that aRect coordinates are specified relative to
  553.    * @param aRect rectangle in twips to test for visibility 
  554.    * @param aMinTwips is the min. pixel rows or cols at edge of screen 
  555.    *                  needed for object to be counted visible
  556.    * @param aRectVisibility returns eVisible if the rect is visible, 
  557.    *                        otherwise it returns an enum indicating why not
  558.    */
  559.   NS_IMETHOD GetRectVisibility(nsIView *aView, const nsRect &aRect, 
  560.                                PRUint16 aMinTwips, 
  561.                                nsRectVisibility *aRectVisibility)=0;
  562.  
  563.   /**
  564.    * Dispatch a mouse move event based on the most recent mouse
  565.    * position.  This is used when the contents of the page moved
  566.    * (aFromScroll is false) or scrolled (aFromScroll is true).
  567.    */
  568.   NS_IMETHOD SynthesizeMouseMove(PRBool aFromScroll)=0;
  569. };
  570.  
  571. // Paint timing mode flags
  572.  
  573. // intermediate: do no special timing processing; repaint when the
  574. // toolkit issues an expose event (which will happen *before* PLEvent
  575. // processing). This is essentially the default.
  576. #define NS_VMREFRESH_NO_SYNC            0
  577.  
  578. // least immediate: we suppress invalidation, storing dirty areas in
  579. // views, and post an Invalidate PLEvent. The Invalidate event gets
  580. // processed after toolkit events such as window resize events!
  581. // This is only usable with EndUpdateViewBatch and EnableRefresh.
  582. #define NS_VMREFRESH_DEFERRED           0x0001
  583.  
  584. // most immediate: force a call to nsViewManager::Composite, which
  585. // synchronously updates the window(s) right away before returning
  586. #define NS_VMREFRESH_IMMEDIATE          0x0002
  587.  
  588. //animate scroll operation
  589. #define NS_VMREFRESH_SMOOTHSCROLL       0x0008
  590.  
  591. #endif  // nsIViewManager_h___
  592.